package com.example.flowable.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.flowable.mapper.UserMapper;
import com.example.flowable.model.User;
import com.example.flowable.service.UserService;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;
    @Override
    public void addUser(User user) {
        userMapper.insert(user);
    }

    @Override
    public List<User> queryUserList(User user) {
        return userMapper.selectList(new QueryWrapper<>());
    }

    @Override
    public void deleteUser(User user) {
        userMapper.delete(new QueryWrapper<User>().eq("id", user.getId()));
    }
}
